home *** CD-ROM | disk | FTP | other *** search
- Path: lsi.lsil.com!dsa129!song
- From: song@lsil.com (Song Liang)
- Newsgroups: comp.lang.c++
- Subject: How to print a enum variable's names
- Date: 5 Jan 1996 17:52:58 GMT
- Organization: LSI Logic Corporation
- Distribution: world
- Message-ID: <4cjohq$k5u@lsi.lsil.com>
- Reply-To: song@lsil.com sliang@cc.gatech.edu
- NNTP-Posting-Host: 147.145.58.129
-
- Suppose you have a variable foo of type "enum bar_type {CAR TRUCK VAN}", if
- you do "cout << foo", it will print either 0, 1 or 2. Is there a simple trick
- to print the names, i.e CAR, TRUCK or VAN?
-
- Thanks in advance.
-
- ---
-
- ---------------------------------------------------------------------------
- Song Liang Third Party Interface & CAD - dept. 7221 +-----+
- LSI Logic Corporation Phone: (408) 433-4531 LSI|LOGIC|
- 1501 McCarthy Blvd. M/S E-192 FAX: (408) 433-4156 | |
- Milpitas, Ca. 95035 Email: song@lsil.com +-----+
- ---------------------------------------------------------------------------
-
-